package com.bibrApp.difu.utils;

import android.text.TextUtils;

/**
 * @des 字符串截取功能类
 * @author dj
 */
public class StringSplitUtil {
    /**
     * @param str
     * @return 交换后的交易对字符串
     */
    public static String SpiltString2Str(String str){
        if(TextUtils.isEmpty(str)){
            throw new RuntimeException("str is null");
        }else {
            String []splitName = str.split("_");
            return splitName[1] + "/" + splitName[0];
        }
    }

    public static String[] SpiltString2Array(String str){
        try{
            if(TextUtils.isEmpty(str)){
                throw new RuntimeException("str is null");
            }else {
                String []splitName = str.split("_");
                return splitName;
            }
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }

    }
}
